import Vue from 'vue';
import iView from 'iview';
import VueRouter from 'vue-router';
import Routers from './router';
import Vuex from 'vuex';
import Util from './libs/util';
import App from './app.vue';
import 'iview/dist/styles/iview.css';
import axios from 'axios';
import VueAxios from 'vue-axios';
axios.defaults.headers.post['Content-Type']='application/x-www-form-urlencoded';
Vue.use(VueAxios, axios);

Vue.use(VueRouter);
Vue.use(Vuex);

Vue.use(iView);



// 路由配置
const router = new VueRouter({
    mode: 'history',
    routes: Routers
});

// router.beforeEach((to, from, next) => {
//     iView.LoadingBar.start();
//     Util.title(to.meta.title);
//     next();
// });

// router.afterEach(() => {
//     iView.LoadingBar.finish();
//     window.scrollTo(0, 0);
// });


// const store = new Vuex.Store({
//     state: {

//     },
//     getters: {

//     },
//     mutations: {

//     },
//     actions: {

//     }
// });


new Vue({
    el: '#app',
    router,
    // store: store,
    render: h => h(App)
});